package org.rc.dto;

import lombok.Data;
import org.rc.entity.ConversationRecord;

import java.time.LocalDateTime;

@Data
public class ConversationPageRes {

    private Long id;

    private Long userId;

    private String userName;

    private Long roomId;

    private String roomName;

    private LocalDateTime beginTime;

    private LocalDateTime endTime;

    private String remark;

    public static ConversationPageRes getInstance(ConversationRecord conversationRecord){
        ConversationPageRes conversationPageRes = new ConversationPageRes();
        conversationPageRes.setId(conversationRecord.getId());
        conversationPageRes.setUserId(conversationRecord.getUserId());
        conversationPageRes.setRoomId(conversationRecord.getRoomId());
        conversationPageRes.setBeginTime(conversationRecord.getBeginTime());
        conversationPageRes.setEndTime(conversationRecord.getEndTime());
        conversationPageRes.setRemark(conversationRecord.getRemark());
        return conversationPageRes;
    }
}
